/**
 * 
 */
package com.gosophia.orgManagement.action;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.web.action.BaseSupportAction;
import com.gosophia.organizationManagement.dto.OrganizationDTO;
import com.gosophia.organizationManagement.ws.OrganizationManagementWebService;

/**
 * 修改机构排序用action
 * @author wangxinbing
 * @since  2010-12-31
 *  Copyright (c) 2010 Gosophia corporation All Rights Reserved
 */
@Controller("UpdateOrgOrderIndexAction")
@Scope("prototype")
public class UpdateOrgOrderIndexAction extends BaseSupportAction{
    private static final long serialVersionUID = 1L;
    private OrganizationDTO orgDTO;
    private Long toId;
    private OrganizationDTO organizationDTO;
    private List<OrganizationDTO> organizationDTOs;
    @Autowired
    private OrganizationManagementWebService organizationManagementWebService;
    @Override
    public String _execute()throws Exception{
        
        organizationDTOs = organizationManagementWebService.updateOrgOrderIndex(orgDTO.getOrgId(), toId);
        super.getRequestResult().setRsltCode("0");
        return SUCCESS;
    }

    public OrganizationDTO getOrgDTO() {
        return orgDTO;
    }

    public void setOrgDTO(OrganizationDTO orgDTO) {
        this.orgDTO = orgDTO;
    }

    public Long getToId() {
        return toId;
    }
    public void setToId(Long toId) {
        this.toId = toId;
    }

    public OrganizationDTO getOrganizationDTO() {
        return organizationDTO;
    }

    public void setOrganizationDTO(OrganizationDTO organizationDTO) {
        this.organizationDTO = organizationDTO;
    }

    public List<OrganizationDTO> getOrganizationDTOs() {
        return organizationDTOs;
    }

    public void setOrganizationDTOs(List<OrganizationDTO> organizationDTOs) {
        this.organizationDTOs = organizationDTOs;
    }
    
}
